//
//  ZPBThreeCollectionViewCell.m
//  Pods
//
//  Created by boys on 16/3/21.
//
//

#import "ZPBThreeCollectionViewCell.h"

@implementation ZPBThreeCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.bgImage = [[UIImageView alloc] init];
        _bgImage.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_bgImage];
        
        self.titleLabel = [[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_titleLabel];
        
        self.subTitleLabel = [[UILabel alloc] init];
        _subTitleLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_subTitleLabel];
        
        self.sImage = [[UIImageView alloc] init];
        _sImage.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_sImage];
        
    }
    return self;
}



-(void)layoutSubviews {
    [super layoutSubviews];
    [_bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(5);
        make.bottom.offset(-5);
        make.left.offset(15);
        make.height.width.offset(60);
    }];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(15);
        make.left.equalTo(_bgImage.mas_right).with.offset(10);
        make.width.offset(200);
        make.height.offset(20);
        
    }];
    
    [_subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(40);
        make.left.equalTo(_titleLabel);
        make.width.offset(200);
        make.height.offset(15);
    }];
    
    [_sImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.right.offset(-10);
        make.width.height.offset(20);
    }];
}

@end
